@extends('layouts.app')

@section('content')



<script src="{{ URL::asset('/') }}js/html2canvas.js"></script>





<script type="text/javascript">
function takeScreenshot() {
  console.log('test');
    html2canvas(document.getElementById('view'), {
        onrendered: function(canvas) {
            console.log(canvas);
            var myImage = canvas.toDataURL("image/jpeg");  //base64
             console.log(myImage);

             var urls = "{{url('admin/case/uptyxq')}}";
             var casid = "{{$case->case_id}}";

            //并将图片上传到服务器用作图片分享  
            $.ajax({  
                type : "POST",  
                url : urls,  
                data: {'img':myImage,'_token':'{{csrf_token()}}','caseid':casid},
                dateType: 'json',    
               
                success : function(data){
                    var obj = eval( "(" + data + ")" );
                     console.log(obj);
                      if (obj.style == 1) {
                       alert(obj.message);
                       self.location= "{{url('admin/case/index')}}"; 
                     }
                    
                
                    
                    // $('#myShowImage').attr('src', '${ctxStatic}/usertemp/'+data+'.jpg'); //服务器上保存图片路径，data是返回的文件名。  
                }  
            });  

           
        },
      width: 900,
      
    });
}
</script>



     <div class="content">
        <div class="main-content">
    
     <div class="row">
     <button class="btn btn-primary" onclick="takeScreenshot()">提交</button>

     <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>

                 <div class="form" id="view" style="background-color: #FFF;width:900px;">
                  <div class="table">
                    <div class="center-block">
                      <span class="input_tit">{{$user->name}}</span>
                    </div>
                    <h1 class="form_tit">同意延期整改治安隐患通知书</h1>
                    <div class="form_head_r">
                      X公（<p class="input_hd"></p>）同字〔<p class="input_hd"></p>〕第<p class="input_hd"></p>号
                    </div>
                    <div class="form_t"><p class="input_n">您好</p>；</div>
                    <div class="form_n">
                      <p>
                        根据《公安机关监督检查企业事业单位内部治安保卫工作规定》第九条规定，经对你单位延期整改治安隐患申请进行审查，认为：
                        <span  class="form_n_txt">{{$headline->yan_liyou}}</span>。
                      <br />
                       同意你单位延期整改治安隐患，延期整改时间从{{$headline->yan_start}}至{{$headline->yan_end}}。
                      </p>
                    </div>
                    <p class="ph1"></p>
                    <div class="form_right">
                      <p>（公安机关印章）</p>
                      <div class="form_time">
                        <span class="w80 bdno"></span>年<span class="w80 bdno"></span>月<span class="w80 bdno"></span>日
                      </div>
                    </div>
                    <div class="form_unit">
                      <p>申请延期整改治安隐患单位：<span class="input_b bdno">{{$unit->name}}</span></p> 
                      <div class="dsp">
                        <span class="w80 bdno"></span>{{$headline->yan_created_at}}
                      </div>
                    </div>
                  </div>
                
                </div>      
          <div class="btn-toolbar list-toolbar btn-toolbar2">
            <!-- <button class="btn btn-primary">确定</button> -->
            
          </div>
        </div>
      </div>

           
        </div>

   


@stop
